package strcy.cn.market.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import strcy.cn.market.pojo.VO.OrderDetailsVO;
import strcy.cn.market.service.OrderDetailsService;
import strcy.cn.market.utils.Result;

import java.util.List;

@RestController
@RequestMapping("/orderDetail")
public class OrderDetailsController {
    @Autowired
    private OrderDetailsService orderDetailsService;

    //根据订单获取订单详情列表
    @GetMapping("{orderId}")
    public Result<List<OrderDetailsVO>> getOrderDetails(@PathVariable("orderId") String orderId) {
        List<OrderDetailsVO> list = orderDetailsService.listByOrderId(orderId);
        return Result.success(list);
    }
}
